<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template match="menuBanner">

<xsl:variable name="selitem">
<xsl:for-each select="menuItem">
<xsl:choose>
	<xsl:when test='count(page[contains(/menuBanner/@actualPage,@url)]) &gt; 0'>
		<xsl:value-of select="@id"/>
	</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<table border="0" cellpadding="0" cellspacing="0" class="body">
<TR>
<TD colspan="2" rowspan="2" background="/imgs/tabs/top_sx.gif"></TD>
<TD COLSPAN="7" height="60px;" background="/imgs/tabs/sfondo_big.gif" width="1%">
<center>

<xsl:choose>
	<xsl:when test='@adRandom &lt; 20'>
		<a href="mailto:info@dammela.it" target="_blank">
      <object width="550" height="400">
        <param name="movie" value="pubblicita.swf"/>
          <embed src="pubblicita.swf" width="728" height="90">
          </embed>
        </object>
    </a>
	</xsl:when>
	<xsl:when test='@adRandom &lt; 40'>
		<a href="http://www.dammela.it/shi/_site/shirodara.html" target="_blank"><img border="0" src="http://www.dammela.it/shi/banner_shirodara.jpg"/></a>
	</xsl:when>
	<xsl:otherwise>
		<object width="728" height="90">
		<param name="movie" value="kilocal_banner.swf"/>
		<embed src="/kilocal_banner.swf" width="728" height="90">
		</embed>
		</object>
	</xsl:otherwise>
</xsl:choose>

</center>
</TD>
<TD width="49%" colspan="2" rowspan="2" background="/imgs/tabs/sfondo_big.gif" valign="bottom"></TD>
</TR>
<tr valign="bottom">
<xsl:for-each select="menuItem">

<xsl:choose>
	<xsl:when test='count(page[contains(/menuBanner/@actualPage,@url)]) &gt; 0'>
		<xsl:choose>
		<xsl:when test='@base'>
			<td width="1%"><a href="{@base}"><img border="0" src="{@simg}" alt="{@item}"/></a></td>
		</xsl:when>
		<xsl:otherwise>
			<td width="1%"><b><nobr><font class="body_red"><xsl:value-of select="@item"/></font></nobr></b></td>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:when>
	<xsl:otherwise>
		<xsl:choose>
		<xsl:when test='@base!="chat"'>
			<td width="1%"><a href="{@base}"><img border="0" src="{@img}" alt="{@item}"/></a></td>
		</xsl:when>
		<xsl:when test='@base="chat"'>
			<td width="1%" onmouseover="ShowTooltipRight('1chat');" onmouseout="HideTooltip('1chat');"><img border="0" src="{@img}"/></td>
		</xsl:when>
		<xsl:otherwise>
			<td width="1%"><nobr><xsl:value-of select="@item"/></nobr></td>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</tr>
<TR>
	<TD width="49%"><IMG SRC="/imgs/tabs/pix_sx.gif" WIDTH="100%" HEIGHT="16px"/></TD>
	<TD><IMG SRC="/imgs/tabs/sx_tb.gif" WIDTH="16" HEIGHT="16"/></TD>
<xsl:for-each select="menuItem[@id=$selitem]">
<xsl:for-each select="subItem">
		<xsl:choose>
		<xsl:when test='@imghref!=""'>
			<TD><a href="{@imghref}"><IMG border="0" SRC="/imgs/tabs/{$selitem}_{@id}.gif" WIDTH="104" HEIGHT="16"/></a></TD>
		</xsl:when>
		<xsl:otherwise>
			<TD><IMG SRC="/imgs/tabs/{$selitem}_{@id}.gif"  HEIGHT="16px"/></TD>
		</xsl:otherwise>
		</xsl:choose>
</xsl:for-each>
</xsl:for-each>
	<TD background="/imgs/tabs/dx_tb.gif" WIDTH="34px" HEIGHT="16px"><IMG SRC="/imgs/tabs/dx_tb.gif"  HEIGHT="16px"/></TD>
	<TD background="/imgs/tabs/pix_dx.gif" WIDTH="49%" HEIGHT="16px"></TD>
</TR>
</table>

</xsl:template>

</xsl:stylesheet>